package com.kamistoat.meimeimall.meimeimallpayment.config;

import com.kamistoat.meimeimall.common.interceptor.GlobalLoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class PaymentWebConfig implements WebMvcConfigurer {
    @Autowired
    GlobalLoginInterceptor globalLoginInterceptor;

    /**
     * 添加MVCInterceptors.
     *
     * @param registry 待实现方法自动填入的参数
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(globalLoginInterceptor).addPathPatterns("/**");
    }
}
